#include "EuClientGUI.h"
#include "EuSocket.h"

HANDLE CEuClientGUI::m_hMutex = NULL;
HINSTANCE CEuClientGUI::m_hInstance = NULL;
HICON CEuClientGUI::m_hIcon_Aborad = NULL;
HICON CEuClientGUI::m_hIcon_Country = NULL;
HICON CEuClientGUI::m_hIcon_Town = NULL;
HICON CEuClientGUI::m_hIcon_Offline = NULL;
HMENU CEuClientGUI::m_hMenu = NULL;
NOTIFYICONDATA CEuClientGUI::m_nd = {0};

CString CEuClientGUI::m_Server = TEXT("");
int CEuClientGUI::m_Port = 44449;
CString CEuClientGUI::m_UserName = TEXT("");
CString CEuClientGUI::m_Password = TEXT("");
CString CEuClientGUI::m_Domain = TEXT("");
LoginDomain CEuClientGUI::m_LoginMethod = abroad;
CString CEuClientGUI::m_ConfigFilePath = TEXT("");
HWND CEuClientGUI::m_hWnd = NULL;

CString CEuClientGUI::m_szNotifyTitle = TEXT("");
CString CEuClientGUI::m_szNotifyInfo = TEXT("");
CString CEuClientGUI::m_szDownload = TEXT("");
CString CEuClientGUI::m_szUpload = TEXT("");
CString CEuClientGUI::m_szUsedMoney = TEXT("");
CString CEuClientGUI::m_szLeftMoney = TEXT("");
CString CEuClientGUI::m_szLastTime = TEXT("");
BOOL CEuClientGUI::m_bOnline = FALSE;
DWORD CEuClientGUI::m_CheckInterval = 0;
DWORD CEuClientGUI::m_FlowThreshold = 0;

DWORD CEuClientGUI::m_Hotkey_Abroad = 0;
DWORD CEuClientGUI::m_Hotkey_Town = 0;
DWORD CEuClientGUI::m_Hotkey_Country = 0;
DWORD CEuClientGUI::m_Hotkey_Offline = 0;
DWORD CEuClientGUI::m_Hotkey_Query = 0;
////////////////////////////////////////////////////////////////
//CEuSocket
//////////////////////////////////////////////////////////////////
CString CEuSocket::m_HostName = TEXT("");
int CEuSocket::m_Port = 0;
CString CEuSocket::m_UserName = TEXT("");
CString CEuSocket::m_Password = TEXT("");
CString CEuSocket::m_Domain = TEXT("");
LoginDomain CEuSocket::m_LoginMethod = abroad;
BINARYARRAY CEuSocket::m_EnUserName = {0};
BINARYARRAY CEuSocket::m_EnDomain = {0};
BINARYARRAY CEuSocket::m_EnPassword = {0};
BINARYARRAY CEuSocket::m_EnMAC = {0};
BINARYARRAY CEuSocket::m_EnData = {0};
BINARYARRAY CEuSocket::m_EnMode = {0};
DWORD CEuSocket::m_KeepMsg[2] = {0};
DWORD CEuSocket::m_EnKey[4] = {0};
DWORD CEuSocket::m_DeKey[4] = {0};
DWORD CEuSocket::m_UDPKey[4] = {0};
CString CEuSocket::m_LeftMoney = TEXT("");
CString CEuSocket::m_UsedMoney = TEXT("");
LARGE_INTEGER CEuSocket::m_DownloadBit = {0};
LARGE_INTEGER CEuSocket::m_UploadBit = {0};
DWORD CEuSocket::m_LoginTime = 0;
CString CEuSocket::m_ErrorMsg = TEXT("");
CString CEuSocket::m_ProtocolVer = TEXT("");
DWORD CEuSocket::m_LastTime = 0;

SOCKET CEuSocket::m_sockServer = INVALID_SOCKET;
BYTE CEuSocket::m_SendBuf[BUFSIZ] = {0};
BYTE CEuSocket::m_ReceiveBuf[BUFSIZ] = {0};
sockaddr_in CEuSocket::m_addrServer = {0};
HOSTENT CEuSocket::m_RemoteHost = {0};
CEuSocket *CEuClientGUI::m_pEuSocket = NULL;

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd)
{
	CEuClientGUI * pEuClientGui = new CEuClientGUI(hInstance);
	pEuClientGui->CreateWnd();
	delete pEuClientGui;
	return 0;
}